package cn.edu.ctbu.datajpa01.aspect;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.annotation.*;
import org.springframework.stereotype.Component;

@Component
@Aspect
@Slf4j
public class httpAspect {
    @Pointcut("execution(* cn.edu.ctbu.datajpa01.webapi.StudentRestController.*(..))")
   public void log(){

    }
    @Before("log()")
    public void doBefore(){
        System.out.println("准备开始执行list...");
    }

    @After("log()")
    public void doAfter(){
        System.out.println("执行list完，准备返回...");
    }

    @AfterReturning(returning = "object",pointcut = "log()")
    public void AfterR(Object object){
        log.info("response={},object");
    }

}
